<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

<h:head>
        <link rel="stylesheet" type="text/css" href="#{resource['css:styles.css']}" />    
</h:head>
    
    <ui:composition template="templates/content.xhtml">
        <ui:define name="content">  
                <h:body>
                    <h:form>
                        Email: <h:inputText id="email" value="#{farmUserController.bean.email}"> 
                            <f:ajax event="keyup" execute="email" render="response"/> 
                        </h:inputText>
                        <h:outputText id="response" value="#{farmUserController.isAvailable(farmUserController.bean.email)}"></h:outputText>
                        <br/><br/>

                        Password: <h:inputSecret id="password" value="#{farmUserController.bean.password}" redisplay="false"/>
                        <br/><br/>

                        <h:commandButton id="submit" value="Submit" action="#{farmUserController.createUser()}"/>

                    </h:form>
                </h:body>
        </ui:define>
    </ui:composition>
</html>